public class B07 {
    public static void main(String[] args) {
        int[] arr={1,5,2,8,4,12,66,54,77,17,98,41};
        int[]li=getmax(arr);
        System.out.println(li[0]);
        System.out.println(li[1]);
    }
        public static int[] getmax(int[] arr) {
            int max=arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > max) {
                max = arr[i];
            }
        }
            int min=arr[0];
            for (int i = 0; i < arr.length; i++) {
                if (arr[i] <min) {
                    min = arr[i];
                }
            }

         int[]maxmin={min,max};



   return maxmin;

    }
}
